import request from '@/utils/request';

/**
 * 保存
 * @param {*} param0
 */
export const save = systemInfo => {
  return request({
    url: '/admin/security/save',
    data: systemInfo,
    method: 'post'
  });
};

/**
 * 更新
 * @param {*} param0
 */
export const update = systemInfo => {
  return request({
    url: '/admin/security/update',
    data: systemInfo,
    method: 'post'
  });
};

/**
 * 获取
 * @param {*} id
 */
export const get = id => {
  return request({
    url: '/admin/security/get',
    data: {
      id: id
    },
    method: 'post'
  });
};

/**
 * 删除
 * @param {*} id
 */
export const remove = id => {
  return request({
    url: '/admin/security/delete',
    data: {
      id: id
    },
    method: 'post'
  });
};

/**
 * 分页查询
 * @param {*} page
 */
export const page = page => {
  return request({
    url: '/admin/security/page',
    data: page,
    method: 'post'
  });
};

/**
 * 生成密钥对
 * @param encryptType  加密类型  0、RSA  1、DES  2、AES
 * @param keySize      密钥长度
 */
export const gennerateKey = ({ encryptType, keySize }) => {
  const params = {
    encryptType: encryptType,
    keySize: keySize
  };
  return request({
    url: '/admin/security/generateKey',
    data: params,
    method: 'post'
  });
};
